<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui" template="/layout/dialogLayout.xhtml">

	<ui:param name="param_panelTitle" value="新建任务" />
	<ui:param name="param_panelWidth" value="600px" />

	<ui:define name="content">
		<a:form>
			<rg:titlePanel type="writable" needButton="true" headerTitle="新建任务">
				<rg:fieldSet column="single" labelWidth="80px">
					<rg:field id="customer" label="姓名或者手机号码">
						<h:inputText id="customer" styleClass="text" value="#{taskDailyAction.taskDaily.customer}"
							converter="#{customerMoblieConverter}">
							<a:support event="onblur" reRender="memberDetail" ajaxSingle="true" eventsQueue="customer" />
						</h:inputText>
					</rg:field>
				</rg:fieldSet>
				<rich:suggestionbox id="suggestionBoxId" for="customer" tokens=",[]"
					suggestionAction="#{memberMoblieProvider.getSuggestionItems}" var="result" fetchValue="#{result.mobile}"
					minChars="1" eventsQueue="customer" nothingLabel="无此会员信息" columnClasses="center" usingSuggestObjects="true">
					<h:column>
						<h:outputText value="#{result.name}" />
					</h:column>
					<h:column>
						<h:outputText value="#{result.mobile}" />
					</h:column>
				</rich:suggestionbox>
				<h:panelGroup id="memberDetail">
					<rg:fieldSet column="double" labelWidth="80px">
						<rg:outputText id="customer_name" label="#{messages.luyuan_member_name}"
							value="#{taskDailyAction.taskDaily.customer.name}" />
						<rg:outputText id="customer_gender" label="性别" value="#{taskDailyAction.taskDaily.customer.gender}" />
						<rg:outputText id="customer_mobile" label="#{messages.luyuan_member_mobile}"
							value="#{taskDailyAction.taskDaily.customer.mobile}" />
						<rg:outputText id="customer_memberIntegral_memberLevel" converter="#{memberLevelConverter}" label="会员等级"
							value="#{taskDailyAction.taskDaily.customer.memberIntegral.memberLevel}" />
						<rg:outputText id="customer_memberGroups" label="会员类别" converter="#{memberGroupsConverter}"
							value="#{taskDailyAction.taskDaily.customer.memberGroups}" />
						<rg:outputText id="customer_liveness" label="会员状态" messagePrefix="luyuan_crm_member_liveness_"
							converter="#{messageConverter}" value="#{taskDailyAction.taskDaily.customer.liveness}" />
						<rg:outputText id="customer_loyalty" messagePrefix="luyuan_crm_member_loyalty_" converter="#{messageConverter}"
							label="忠诚度" value="#{taskDailyAction.taskDaily.customer.loyalty}" />
					</rg:fieldSet>
				</h:panelGroup>
				<rg:fieldSet column="single" labelWidth="80px">
					<rg:inputArea id="description" required="true" label="任务描述" textStyle="width:368px;height:256px;"
						value="#{taskDailyAction.taskDaily.description}" />
					<rg:calendar id="executionTime" value="#{taskDailyAction.taskDaily.expectedTime}" label="执行时间"
						datePattern="yyyy-MM-dd HH:mm" />
				</rg:fieldSet>
				<ui:define name="panelButton">
					<a:commandButton styleClass="button" value="添加"
						oncomplete="UI.instance.reRender('reRenderTaskDailyTable');UI.instance.closeDialog();"
						actionListener="#{taskDailyAction.createTaskDaily()}" />

					<a:commandButton styleClass="button" value="取消" onclick="UI.instance.closeDialog()" />
				</ui:define>
			</rg:titlePanel>
		</a:form>
	</ui:define>
</ui:composition>
